#ifndef NOTETASK_H
#define NOTETASK_H

#include "note.h"
#include "globalPara.h"
#include <QtGui/QDialog>

namespace Ui {
    class NoteTask;
}

class NoteTask : public QDialog
{
    Q_OBJECT

public:
    explicit NoteTask(QWidget *parent = 0);
    NoteTask(qint32 _screenWidth, qint32 _screenHeight,NoteItemMap * _pItemMap);
    ~NoteTask();

    void init(qint32,qint32);
    void setWidth(qint32);
    void setHeight(qint32);
    void setPosition(QPoint);
    void setSize(QSize);
    void update(NoteItemMap * pItemMap);
    void updateUI();
    void updateData(NoteItemMap * pItemMap);//get current data from outside
    void initEachItemUI(NoteType type,QString dateTitle,qint32 idx=0,qint32 progress=0);//initial note and task ui from data;

    qint32 getWidth()
    {return _size.width();}
    qint32 getHeight()
    {return _size.height();}
    QPoint getPosition()
    {return _pos;}
    QSize getSize()
    {return _size;}


    void clearLayout();
private:
    QSize   _size;
    QPoint  _pos;
    NoteItemOneDay _allValid_Note;//conserve items for update note;<key=string(QDateQTime)>
    NoteItemOneDay _allValid_Task;//conserve items for update task;
    QVBoxLayout * _pVLayout;//organize all label and progressbars
    QVBoxLayout * _pVLayout_Note;
    QVBoxLayout * _pVLayout_Task;
    QMap<qint32,QLabel*> _labels;//conserve notes
    QMap<qint32,QProgressBar*> _progBar;//conserve tasks
private:
    Ui::NoteTask *ui;
};

#endif // NOTETASK_H
